<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;

use Think\Controller;

class EslController extends Controller
{
    public function index(){
        $this->assign('list', "");
        $this->display();
    }
    public function setting(){
        $list = D("esl_controller")->where("id=1")->select();

        $return=Array();
        $return["id"]=$list[0]["id"];
        $return["controller_ip"]=$list[0]["controller_ip"];
        $return["light_addr"]=$list[0]["light_addr"];
        $return["esl_addr"]=$list[0]["esl_addr"];
        die(json_encode($return));
    }
    public function savesetting(){
        $list = D("esl_controller")->where("id=1")->select();
        $this->assign('list', $list);

        $return=Array();
        $return["esl"]=$list;
        die(json_encode($return));
    }

    public function loadbill(){
        $list = D("esl_billsub")->where("billid=1")->select();
        $this->assign('list', $list);

        $return=Array();
        $return["esl"]=$list;
        $return["ip"]="192.168.0.227";
        $return["port"]="6780";
        die(json_encode($return));
    }


}
